Reducing processing resources incurred by a user interface

ABSTRACT

A method, program and apparatus for limiting processing resources incurred due to refreshing a user interface of a first terminal. The method comprises: at a first terminal, receiving a plurality of event indications which indicate respective events, each of the event indications being received at a different time; and based on the event indications, refreshing the user interface of the first terminal to reflect each of the respective events. Refreshing comprises determining a plurality of time periods, and during each of those time periods postponing the user interface from being refreshed to reflect any outstanding ones of the event indications until that time period has elapsed. The time periods are each determined having a length set in dependence on a timing of the receipt of one or more of the event indications, wherein the length of a later time period is set to an increased value relative to an earlier time period in response to the receipt of one or more of said event indications within a time limit.

RELATED APPLICATION

This application claims priority under 35 U.S.C. §119 or 365 to GreatBritain, Application No. 0912507.1, filed Jul. 17, 2009. The entireteachings of the above application are incorporated herein by reference.

TECHNICAL FIELD

The present invention relates to a method, apparatus and program forlimiting the processing resources incurred due to refreshing a userinterface.

BACKGROUND

Some communication systems allow the user of a device, such as apersonal computer, to communicate across a packet-based computer networksuch as the Internet. Such communication systems include voice overinternet protocol (“VoIP”) systems. These systems are beneficial to theuser as they are often of significantly lower cost than conventionalfixed line or mobile networks. This may particularly be the case forlong-distance communication. To use a VoIP system, the user installs andexecutes client software on their device. The client software sets upthe VoIP connections as well as providing other functions such asregistration and authentication. In addition to voice communication, theclient may also set up connections for other communication media such asvideo calling, instant messaging (“IM”), SMS messaging, file transferand voicemail.

One type of communication system for packet-based communication uses apeer-to-peer (“P2P”) topology. To enable access to a peer-to-peersystem, a user must execute P2P client software provided by a P2Psoftware provider on their computer, and register with the P2P system.When the user registers with the P2P system, the client software isprovided with a digital certificate from a server. Once the clientsoftware has been provided with the certificate, then calls or othercommunication connections can subsequently be set up and routed betweenusers of the P2P system without the further use of a server in theset-up. Instead, the client looks up the required IP addresses frominformation distributed amongst the P2P client software on other endusers' computers within the P2P system. That is, the address look-uplist is distributed amongst the peers themselves. Once the IP address ofa callee's terminal has thus been determined, the caller's P2P clientsoftware then exchanges certificates with the callee's P2P clientsoftware. The exchange of the digital certificates (or user identitycertificates, “UIC”) between users provides proof of the users'identities and that they are suitably authorised and authenticated inthe P2P system. Therefore, the presentation of digital certificatesprovides trust in the identity of the users.

It is therefore a characteristic of peer-to-peer communication that,once registered, the users can set up their own communication routesthrough the P2P system in an at least partially decentralized mannerbased on distributed address look-up and/or the exchange of one or moredigital certificates, without using a server for those purposes. Furtherdetails of an example P2P system are disclosed in WO 2005/009019.

VoIP or other packet-based communications can also be implemented usingnon-P2P systems that do use centralized call set-up, e.g. via server.

Sometimes software programs such as communication clients must respondto asynchronous events, specifically state and/or data changes due toexternal events such those that occur over a network. To convey theseevents to the end user, the program must refresh one or more userinterface elements on screen. “Refresh” in this context means theprocess of reading a new data value and then redrawing the value in someuser interface element on screen. Example: user A is chatting with userB. When user B sends data or goes offline, such changes must be shown byrefreshing the user interface element corresponding to user B on userA's screen.

The most simplistic method is to refresh the user interface directly inresponse to receiving an indication of such an event. This works well inthe common case, but if the rate of incoming event indications is veryhigh then the user interface will be needlessly refreshed too often,causing a performance problem.

One solution to address this performance problem is to provide aperiodic timer that fires at a constant interval, e.g. every 1 second.In some implementations, this timer may always be running, regardless ofwhether there are any incoming events or not. In other implementations,this timer may be enabled only during the period in which there are arapid succession of incoming events. Either way, the refreshing is doneon a simple periodic basis, sometimes referred to as polling.

Another solution is to provide a delay in which refreshing the userinterface is put “on hold”. Refreshes occur again only until after thedelay runs out. In this case, the refresh is not performed at all (i.e.is completely suspended) until the incoming activity has calmed by someamount.

SUMMARY

Despite the existing solutions, the inventor has recognised there isstill scope for improving the trade-off between the responsiveness ofthe user interface and the number of processing cycles used refreshingthat user interface.

According to one aspect of the present invention, there is provided amethod for limiting processing resources incurred due to refreshing auser interface of a first terminal, the method comprising: at a firstterminal, receiving a plurality of event indications which indicaterespective events, each of the event indications being received at adifferent time; and based on the event indications, refreshing the userinterface of the first terminal to reflect each of the respectiveevents; wherein said refreshing comprises determining a plurality oftime periods, and during each of said time periods postponing the userinterface from being refreshed to reflect any outstanding ones of saidevent indications until that time period has elapsed; and wherein saidtime periods are each determined having a length set in dependence on atiming of the receipt of one or more of said event indications, thelength of a later of said time periods being set to an increased valuerelative to an earlier of said time periods in response to the receiptof one or more of said event indications within a time limit.

Using this method, the refresh rate is not constant but ratherdetermined relative to the incoming indications of events. For example,when the rate of incoming event indications is low then the userinterface may be refreshed immediately. This provides maximum perceivedresponsiveness. When the rate of incoming event indications is high, therefresh rate may be throttled down. This ensures that the too manyprocessing cycles are not used in refreshing the user interface, e.g. sothat user interface updates do not “steal cycles” from other processingrequired in relation to the events.

In embodiments, said event indications preferably indicate respectiveevents occurring externally to the first terminal.

The method may be a method of limiting processing resources incurred dueto refreshing a user interface of a first terminal in a communicationsystem for communicating between the first and other terminals via apacket-based network; and the receipt of said event indications maycomprises: at the first terminal of the communication system, receivinga plurality of event indications signalled over the packet-based networkto indicate respective events occurring in relation to one or more ofthe other terminals of the communication system.

The method may comprise receiving further event indications indicativeof events occurring locally at the first terminal, and said time periodsmay be determined in dependence on the timing of receipt of one or moreevent indications indicating either one of an external and a localevent.

The time limit may be the expiry of earlier time period running sincelast refresh of the user interface.

The time limit may be based on a time interval between the receipt oftwo event indications.

The event indications may be received asynchronously with respect to thefirst terminal.

Said refreshing may comprise, during at least one of said time periods,postponing the user interface from being refreshed to reflect anoutstanding plurality of said event indications until that time periodhas elapsed, such that following said time period the user interface isrefreshed to reflect the plurality of outstanding event indications inthe same refresh operation.

Said time periods may each be determined having a length set accordingto a substantially exponential back-off process, whereby the length ofthe later time period is multiplied by a predetermined factor relativeto the earlier time period in response to receipt of one or more of saidevent indications within said time limit.

The method may comprise constraining the length to being set within amaximum cap value.

The length of the later time period may be increased unless fewer than apredetermined number of said event indications are received during theearlier time period. The length of the later time period may beincreased unless none of said event indications are received during theearlier time period.

The length of the later timer period may be reset to a lower value iffewer than a predetermined number of event indications are receivedduring the earlier time periods. The length of the later time period maybe reset if none of said event indications are received during theearlier time period.

If at least a predetermined number of said event indications arereceived within the earlier time period running since the last refresh,then next refresh of the user interface may be postponed until theearlier time period has elapsed and the length of the later time periodmay be increased, the later time period running from the next refresh.

If fewer then a predetermined number of said event indications arereceived within the earlier time period running since the last refresh,then the next refresh of the user interface may not be postponed and thelength of the later time period running from that next refresh may bereset to a lower value.

If any of said event indications arrives within the earlier time periodrunning since the last refresh, then the next refresh of the userinterface may be postponed until the earlier time period has elapsed andthe length of the later period running from that next refresh may beincreased.

If none said event indications arrives within the earlier time periodrunning since the last refresh, then the next refresh of the userinterface may not be postponed and the length of the later time periodrunning from that next refresh may be reset to a lower value.

Said time periods may be determined according to the following process:

at program initialisation, set a delay to an initial value, the delaybeing a variable setting the lengths of said time periods;

upon receiving one of said event indications:

-   -   (a) calculate a time difference between a current clock time and        a time of last refresh;    -   (b) if the time difference is greater than the delay:        -   (i) perform the user interface refresh and save the current            clock time as the time of last refresh,        -   (ii) reset the delay to the initial value;    -   (c) if the time difference is less than the delay:        -   (i) if there is no current refresh timer then schedule a            refresh timer to fire at the last refresh time plus the            delay,        -   (ii) if there is already a current refresh timer then do not            schedule another refresh timer; when the refresh timer            fires:    -   (d) perform the user interface refresh and save the current        clock time as the time of last refresh;    -   (e) multiply the delay by a predetermined factor.

Although the processing cost of a refresh operation may be less of aproblem for higher performance desktop or laptop PCs, it may start tobecome a particular problem with the rise of VoIP communicationsimplemented on internet-enabled mobile phones, where processingresources are more limited.

Therefore in one particularly advantageous application of the presentinvention: the first terminal may be a mobile terminal, and saidcommunication system may be a VoIP system, the mobile terminal beinginstalled with a VoIP client for communicating with the other terminalsvia a mobile cellular network and the internet; the receipt of the eventindications may comprise receiving the event indications via theinternet and mobile cellular network; and the refreshing may compriserefreshing a user interface of the VoIP client.

According to another aspect of the present invention, there is provideda program product for limiting processing resources incurred due torefreshing a user interface of a first terminal, the program comprisingcode embodied on a computer-readable medium and being configured so aswhen executed on the first terminal to: receive a plurality of eventindications which indicate respective events, each of the eventindications being received at a different time; and based on the eventindications, refresh the user interface of the first terminal to reflecteach of the respective events; wherein said refreshing comprisesdetermining a plurality of time periods, and during each of said timeperiods postponing the user interface from being refreshed to reflectany outstanding ones of said event indications until that time periodhas elapsed; and wherein said time periods are each determined having alength set in dependence on a timing of the receipt of one or more ofsaid event indications, the length of a later of said time periods beingset to an increased value relative to an earlier of said time periods inresponse to receipt of one or more of said event indications within atime limit.

The program product may comprise further code configured to perform anyof the additional method steps described herein.

According to another aspect of the present invention, there is provideda first terminal comprising: a receiver configured to receive aplurality of event indications which indicate respective events, each ofthe event indications being received at a different time; a screen fordisplaying a user interface; and processing circuitry, coupled to thereceiver and screen, configured to refresh the user interface based onthe event indications to reflect each of the respective events; whereinthe processing circuitry is configured to generate a plurality of timeperiods, and during each of said time periods to postpone the userinterface from being refreshed to reflect any outstanding ones of saidevent indications until that time period has elapsed; and the processingcircuitry is configured to generate each of said time periods having alength set in dependence on a timing of the receipt of one or more ofsaid event indications, the length of a later of said time periods beingset to an increased value relative to an earlier of said time periods inresponse to receipt of one or more of said event indications within atime limit.

The processing circuitry may be further configured in accordance withany of the methods described herein.

BRIEF DESCRIPTION OF THE DRAWINGS

For a better understanding of the present invention and to show how itmay be carried into effect, reference will now be made by way of exampleto the accompanying drawings in which:

FIG. 1 is a schematic representation of a packet-based network such asthe Internet.

FIG. 2 is a schematic block diagram of a user terminal installed with aweb-client application and P2P client application.

FIG. 3 is a schematic representation of a P2P client application userinterface viewed on a user terminal.

FIG. 4 is a timeline showing an example operation of a UI refreshback-off algorithm.

DETAILED DESCRIPTION

FIG. 1 is a schematic illustration of a packet-based network such as theInternet, which comprises a plurality of interconnected elements such asthose labelled 102, 104, 105 and 106. Each network element isinter-coupled with the rest of the Internet 108, and is configured tocommunicate data with other such elements over the Internet bytransmitting and receiving data in the form of Internet Protocol (IP)packets. Each element also has an associated IP address locating itwithin the Internet. The elements shown explicitly in FIG. 1 are: aplurality of end-user terminals 102(A) to 102(E) such as desktop orlaptop PCs or Internet-enabled mobile phones; one or more P2P servers104; one or more web servers 105; and a gateway 106 to another type ofnetwork 109 such as to a traditional Public-Switched Telephone Network(PSTN) or other circuit switched network, and/or to a mobile cellularnetwork. However, it will of course be appreciated that many moreelements make up the Internet than those explicitly shown. This isrepresented schematically in FIG. 1 by a communications cloud 108 whichwill include many other end-user terminals, servers and gateways, aswell as routers of Internet service providers (ISPs) and Internetbackbone routers.

Each of a plurality of the end-user terminals 102 is installed withcommunication software in the form of a P2P client application. Whenexecuted, this allows the end-user terminals 102 to establishbidirectional communication channels with other such end-user terminals102 via the Internet using P2P call set-up (or more generally connectionset-up). The P2P client applications also share presence informationwith one another, which provides an availability status of users. Thepresence information for each user is preferably at least in partdefined by the user themselves. To supplement the decentralized callset-up, the P2P client application may retrieve some additionalinformation from the P2P server 104, such as contact lists which providethe names and user IDs of the users' contacts, “avatars” which areimages chosen by users to represent themselves within the P2P system.

There may also be a P2P client application installed at one or moregateways 106 coupled to both the Internet 108 and one or more othernetworks 109 such as a PSTN network and/or a mobile cellular network.This allows the P2P client applications running on end-user terminals102 to communicate with ordinary land-line telephones and/or mobiletelephones respectively, even if those telephones themselves do not runP2P client applications and are not directly coupled to the Internet. Inthat case, the P2P client application on the terminal 102 sets up aconnection over the Internet with the P2P client application on thegateway 106 using P2P call set-up and provides it with a phone number,and the gateway 106 uses the phone number to set up a connection withthe telephone over the respective other network. Or in the otherdirection, a telephone user may dial into the gateway 106 with a numberthat identifies the user within the P2P system, and the gateway 106 willset up a connection with that user's terminal 102 over the Internet. Ineither case, a bidirectional communication channel can thus beestablished via the Internet and PSTN or mobile cellular network.

Each of the end-user terminals 102 may also be installed with otherInternet-related software such as a web browser which, when executed,allows the user terminal 102 to retrieve information in the form of webpages from web servers 105 coupled to the Internet 108.

The schematic block diagram of FIG. 2 shows an example of an end-userterminal 102, which is configured to act as a terminal of a P2P systemoperating over the Internet. The terminal 102 comprises a processor orCPU 200 operatively coupled to: a network interface 202 such as modemfor connecting to the Internet 108, a non-volatile storage device 204such as a hard-drive or flash memory, and a volatile memory device suchas a random access memory (RAM) 206. The terminal 102 also comprises oneor more user input devices, for example in the form of a keyboard orkeypad 210, a mouse 208, a microphone 216 and a webcam 218, eachoperatively coupled to the CPU 200. The terminal 102 further comprisesone or more user output devices, for example in the form of a displayscreen 208 and speaker 214, again each operatively coupled to the CPU200.

The storage device 204 stores software including at least an operatingsystem (OS) 220, and packet-based communication software in the form ofa P2P client application 222. The storage device may also store otherInternet-related software such as a web-browser 221. On start-up orreset of the terminal 102, the operating system software 220 isautomatically loaded into the RAM 206 and from there is run by beingexecuted on the CPU 200. Once running, the operating system 220 can thenrun applications such as the web client application 221 and P2P clientapplication 222 by loading them into the into the RAM 206 and executingthem on the CPU 200. To represent this schematically in FIG. 2, theoperating system 220, web client application 221 and P2P clientapplication 222 are shown within the CPU 200.

The P2P client application 222 comprises a “stack” having three basiclayers: an input and output (I/O) layer 224, a client engine layer 226,and a user interface (UI) layer 228. Each layer is responsible forspecific functions. Because each successive layer usually communicateswith two adjacent layers (or one in the case of the top layer), they areregarded as being arranged in a stack as shown in FIG. 2. The web clientapplication 221 and P2P client application 222 are said to be run “on”the operating system 220. This means that in a multi-tasking environmentthey are scheduled for execution by the operating system 220; andfurther that inputs to the web client application 221 and the lowest(I/O) layer 224 of the P2P client application 222 from the input devices202, 216 and 218 as well as outputs from web client application 221 andthe I/O layer 224 of the P2P client application 222 to the outputdevices 202, 208 and 214 may be mediated via suitable drivers and/orAPIs of the operating system 220.

The I/O layer 224 of the P2P client application comprises audio and/orvideo codecs which receive incoming encoded streams and decodes them foroutput to speaker 214 and/or display 208 as appropriate, and whichreceive unencoded audio and/or video data from the microphone 216 and/orwebcam 218 and encodes them for transmission as streams to otherend-user terminals 102 of the P2P system. The I/O layer 224 may alsocomprises a control signalling protocol for signalling controlinformation between terminals 102 of the network.

The client engine 226 then handles the connection management functionsof the P2P system as discussed above, such as establishing calls orother connections by P2P address look-up and authentication. The clientengine may also be responsible for other secondary functions of the P2Psystem such as supplying up-to-date contact lists and/or avatar imagesof the user to the P2P server 104; or retrieving up-to-date contactlists of the user and retrieving up-to-date avatar images of other usersfrom the P2P server 104. Further, the client engine may retrievepresence information from the other clients of the users in the contactlist by periodically polling them via a public API, and reciprocallyprovide its own presence information when polled by those other clientsthat are online. Exchange of presence information directly betweenclients via a public API is the preferred option, but alternatively thepresence information could be exchanged via an intermediate node such asa server 104.

The UI layer 228 is responsible for presenting decoded video to the uservia the display 208, for presenting the output on the display 208 alongwith other information such as presence and profile information and usercontrols such as buttons and menus, and for receiving inputs from theuser via the presented controls.

FIG. 3 illustrates schematically an example user interface as would bepresented to a user on the display 208 when the P2P client application222 is open for viewing by the user. In this example, the user interface228 is that of the P2P client application 222 running on a first userterminal 102(A). The user interface is divided into a number of panels.A first panel 302 displays some details of the user's own profile, inthis example the user's name “Joe Everyman”, an avatar image, and a“mood message”. These details may be stored at and retrieved from theP2P server 104 by the client engine 226, so as to be made available toother users of the P2P network. The avatar image is an image chosen bythe user to represent themselves to other users (which need notnecessarily be a photo of themselves). The mood message is a briefuser-defined statement which can be used for any purpose but istypically used to express how the user is feeling, news about recentevents in the user's life, or any upcoming plans that may affect theuser's availability (the mood message may therefore in some cases beconsidered a type of presence information). When other users view Joe'sprofile in their own clients, these details will be visible to them viathe P2P server 104, and vice versa the other users' details will be madeavailable to Joe's client (if they are in each others' contact lists).

A second panel 304 of the user interface displays a contact list of theuser's friends or associates, these being other users of the P2Pnetwork. Entry in the contact list is preferably conditional onagreement from the users. The contact list may be stored at andretrieved from the P2P server by the client engine 226, so that the samelist is available to the user uses different instances P2P clientapplication on different terminals. Presence information is alsodisplayed in the panel next to each contact. The presence informationrepresents an availability status which preferably comprises anindication of whether the user is online, and preferably is in partuser-defined. For example, the presence status may be: the user isoffline (x), the user is online and has selected to be shown asavailable (√), or the user is online but has selected to be shown as notavailable (−).

A third panel 306 of the user interface displays the profile of aselected user from the contact list, in this case “Stephen Madeup”, auser of another user terminal 102(B). The displayed profile includesStephen's name, avatar image and mood message, along with other detailsStephen may have supplied to the P2P server 104 such as currentlocation, local time, gender and date of birth (DOB). These profiledetails are retrieved from the P2P server 104 by the client engine 226.

A fourth panel 308 of the user interface then displays communicationcontrols in relation to the selected contact, such as buttons allowing avoice or video call to be established, and a window for entering chatmessages. Any incoming chat messages and chat history will be displayedin this panel also, and file transfers may be established bydragging-and-dropping files into the chat window.

As mentioned, the user interface displayed on the screen 208 of a userterminal such as 102(A) will often need to be refreshed in order toreflect events occurring in relation to other, remote terminals of thenetwork, such as other user terminals 102(B . . . E). Indications ofthese events are signalled to the I/O layer 224 via the network 108. Ifan event relates to another user terminal 102(B . . . E), then theindication of that event may be signalled either from the other userterminal itself or from a server 104 that has information about thatother user terminal. Based on the received indications, the UI layer 228then handles the refreshing of user interface to reflect thecorresponding events.

The events typically do not occur in any particular synchronised manner,and so the event indications typically arrive asynchronously withrespect to the receiving user terminal 102(A). That is to say, theyarrive at no particular predictable or regular time from the perspectiveof the receiving terminal 102(A).

Examples of such events are as follows. By way of example, these will bedescribed in terms of a receiving user terminal 102(A) refreshing itsuser interface based on indications of events occurring in relation to aremote user terminal 102(B), but it will be understood that events canbe signalled between any terminals.

One type of event occurs when a remote user's presence has changed, e.g.that user has gone on or off line or has chosen to be shown asunavailable (“do not disturb”). In that case the indication of the eventis preferably signalled directly between the users' terminals 102(A) and102(B) over the network 108, but could alternatively be signalled via aserver 104 or a relaying user terminal such as 102(C). Based on thereceived indication, when the UI layer 228 refreshes the user interfaceit may for example alter a presence icon such as (x), (√), or (−)displayed in co-location with the remote user's name in the contact list304 or profile 306.

Another type of event occurs when a remote user's profile informationhas changed, e.g. the remote user has changed their avatar image or moodmessage. In that case the indication of the event is preferablysignalled to the receiving user terminal 102(A) from the server 104where the profile information of the remote user is stored, in responseto the changed uploaded from the remote user terminal 102(B).Alternatively however, the indication of the event could be signalleddirectly between the users' terminals 102(A) and 102(B) or via arelaying user terminal such as 102(C). Based on the received indication,when the UI layer 228 refreshes the user interface it will alter thedisplayed profile 306 accordingly.

Another type of event occurs when there is call activity in relation toa voice or video call. E.g. if the remote user has initiated a call withthe receiving user terminal 102(A) or has terminated the call. In thatcase the indication of the event is preferably signalled directlybetween the users' terminals 102(A) and 102(B) over the network 108, butcould alternatively be signalled via a server 104 or a relaying userterminal such as 102(C). Based on the received indication, when the UIlayer 228 refreshes the user interface it may for example display amessage or animation in the profile 306 or communication panel 308notifying the receiving user that the remote user is calling them or hasjust hung up, or such like.

Another type of event occurs when the remote user terminal 102(B) sendsdata to the receiving user terminal 102(A), e.g. a chat message which isto be displayed on a screen, or a file transfer whose initiation, statusor progress must be indicated on the screen. In that case the indicationof the event is again preferably signalled directly between the users'terminals 102(A) and 102(B) over the network 108, but couldalternatively be signalled via a server 104 or a relaying user terminalsuch as 102(C). Based on the received indication, when the UI layer 228refreshes the user interface it may for example display a messagenotifying the receiving user of the incoming transfer or its status, ordisplay a percentage or progress bar notifying of the progress of thetransfer.

In relation to an IM chat session, yet another type of event may occurif the client applications of the receiving and remote terminal 102(A)and 102(B) support a “typing indicator” feature. The typing indicatorprovides a notification to the receiving user that the remote user iscurrently typing. E.g. a visual animation such as a scribbling pencilmay be displayed in the communication panel 308 based on an indicationreceived at the receiving terminal 102(A) to indicate the event that theremote user is typing. The indication may also indicate the kind oftyping activity, e.g. so that the displayed notification distinguishesbetween the typing of words and pressing the delete key. The typingindicator helps avoid confusion that could otherwise be caused bycrossed chat messages. In the case of the indication of chat activity,the indication of the event is preferably signalled directly between theusers' terminals 102(A) and 102(B) over the network 108, but couldalternatively be signalled via a server 104 or a relaying user terminalsuch as 102(C).

Another type of event is a history event such as a missed call or anavailable voicemail. In that case the indication of the event ispreferably signalled to the receiving user terminal 102(A) from theserver 104 where the information about the missed call or voicemail isstored, in response to the attempted call from the remote user terminal102(B). Alternatively however, the indication of the event could besignalled directly between the users' terminals 102(A) and 102(B) or viaa relaying user terminal such as 102(C). Based on the receivedindication, when the UI layer 228 refreshes the user interface it willinsert a notification of the missed call or voicemail somewhereappropriate in the user interface.

At any time, various different indications of any of these or othertypes of events may be arriving at the receiving terminal 102(A)asynchronously, and furthermore some may arrive within a short space oftime of each other. If the user interface has to be refreshedstraightaway every time an indication of a new event arrives, then alarge number of processing cycles may be incurred by repeatedly updatingthe user interface.

The inventor has identified two particular situations where such eventscan tend to cause performance problems. The first is on launch of theclient (especially first launch), when the contact list is synchronisedand many “property changed” indications are received. The second alsooccurs on launch (especially first launch), when chats and chat messagesare synchronised. E.g. if the user has been using chat on one device andthen switches to another device, he or she might log in and receivehundreds if not thousands of chat messages when the client syncs.

However, more generally, it will be appreciated that the describedperformance problem can occur in any situation where multiple eventindications arrive.

To try to solve this, the idea is that if the events are close enoughtogether in time then the refreshing of the user interface to reflectone or more of them can be postponed without the user perceiving asignificant lack of responsiveness. If a refresh operation involvesrefreshing a part of the user interface reflecting multiple events (oreven the whole user interface), then this may mean that one or moreoutstanding events can be “saved up” and then multiple events handled inthe same refresh operation. Because the refresh operations may involveanimations or other significant transitions (such as re-sorting thecontact list or auto-scrolling to the newest chat messages), it isadvantageous to collect multiple changes into a single operation so thedisplay and processor are not encumbered with multiple successiverefresh operations. E.g. otherwise this could cause the screen to flitfrom one update to another which would be distracting for the user andmake the user interface awkward to use. But even if different elementsof the user interface are refreshed separately to reflect individualrespective events, then there may still be a performance advantage inpostponing a refresh until a later time when there are fewer otherrefresh operations or other processing operations relating to thehandling of the events themselves such as data processing operations.For example, postponing the refresh can also be advantageous so that theprogram remains responsive in case the user is trying to scroll, type,etc. during this time.

As mentioned, there are some existing solutions. Nonetheless, it wouldstill be desirable to try to optimize the trade-off between theresponsiveness of the user interface and the number of processing cyclesused refreshing that user interface.

According to preferred embodiments of the present invention, theimproved solution is to algorithmically determine the period of timeduring which refreshes are postponed, based on the receipt of incomingevent indications. An algorthim for increasing such a time period may bereferred to herein as a “back-off” algorithm. The algorithm preferablyhas the effect that a greater rate of incoming events tends to result ina greater time period. For example, the algorithm may have the effectthat when the rate of incoming events is low then the user interfacewill be refreshed immediately. This provides maximum perceivedresponsiveness. When the rate of incoming events is high however, therefresh rate may be throttled down. This ensures that the user interfaceupdates do not divert processing cycles from other processing that maybe required at the receiving terminal 102(A), either in relation tohandling the events or otherwise.

The back-off algorithm works by setting a plurality of time periodsduring which refreshes are postponed. These may be referred to herein asdelay periods, each preferably being measured from a respective time oflast refresh. Any event indication that is received within such a delayperiod does not result in the user interface being refreshedimmediately, but instead the user interface is only refreshed to reflectall outstanding event indications once the delay period has elapsed.

Preferably, the back-off algorithm operates such that the length of thedelay period is increased between an earlier to a later time periodunless no event indications are received during the earlier time period.Further, the length of the delay period is preferably reset to somelower value if no indications are received during one of the delayperiods.

A particularly preferred algorithm can be summarised by the followingstatement: if an indication of an event arrives within the current delayperiod running since the time of last refresh, then the refreshing ofthe user interface to reflect that event is postponed until that delayperiod has elapsed, and the next delay period running from that refreshwill be increased in length; but otherwise, if an indication of an eventarrives only after the delay period since the time of last refresh, thenthere is no need to postpone the refreshing of the user interface whenthe next event does arrive and the length of the next delay periodrunning from the next refresh will be reset.

Optionally, the increase and/or resetting of the length of the delayperiod need not necessarily be based on whether no events at all werereceived within the delay period. Alternatively, one or both of theseactions could be based on whether there were fewer than a predeterminednumber of events received within that period.

Preferably the algorithm is a substantially exponential back-offalgorithm, whereby the length of the next delay period is multiplied bya factor in response to asynchronous incoming events. In embodiments themultiplication is applied when the last delay period has elapsed and theuser interface refreshed, and at least one event indication was receivedduring that last delay period.

In some implementations, a maximum cap may be applied to the delay sothat even during a steady stream of incoming events, the user interfaceis still updated somewhat periodically.

An example back-off algorithm is now described.

At program initialisation, set the delay to a small constant value, e.g.0.1 seconds.

Upon receiving an incoming indication of an event:

-   -   (a) Calculate the time difference between the current clock time        and the time of the last refresh.    -   (b) If the time difference is greater than the delay:        -   (i) Perform the user interface refresh immediately, and save            the current clock time.        -   (ii) Reset the delay to the initial value.    -   (c) If the time difference is less than the delay:        -   (i) If there is no current refresh timer, schedule a            one-shot timer to fire at the last refresh time+the delay.        -   (ii) If there is a current refresh timer, do nothing. The            timer will handle the refresh at the scheduled time.

When the refresh timer fires:

-   -   (d) Perform the user interface refresh immediately, and save the        current clock time.    -   (e) Multiply the delay by a fixed factor, e.g. 2.

An example operation of this algorithm is set out in the example below,and also illustrated in the timeline of FIG. 4.

Time Description

[00:00:00] Incoming event indication[00:00:00]<--Refresh immediately (Delay=1)[00:00:01] Incoming event indication//timer scheduled for 0:00:02[00:00:02]<--Timer refresh (new Delay=2)[00:00:02] Incoming event indication//timer scheduled for 0:00:04[00:00:03] Incoming event indication//ignored[00:00:04]<--Timer refresh (new Delay=4)[00:00:04] Incoming event indication//timer scheduled for 0:00:08[00:00:05] Incoming event indication//ignored[00:00:07] Incoming event indication//ignored[00:00:08]<--Timer refresh (new Delay=8)[00:00:09] Incoming event indication//timer scheduled for 0:00:16[00:00:11] Incoming event indication//ignored[00:00:14] Incoming event indication//ignored[00:00:15] Incoming event indication//ignored[00:00:16]<--Timer refresh (new Delay=8)[00:00:25] Incoming event[00:00:25]<--Refresh immediately (Delay=1)

In this example, at some time arbitrarily referred to as t=0 an eventindication arrives for the first time since program initialisation.There is no defined time of last refresh, so the user interface isrefreshed straightaway. Suppose then that at a subsequent time t=1,another event indication arrives. This is within the initial delayperiod D=1 of the last refresh, and therefore according to the algorithmthe user interface is not refreshed straightaway but instead a refreshtimer is set to fire (actuate) at the initial delay time D=1 plus thetime of last refresh t=1, i.e. at time t=2. When the refresh timer thendoes fire at time t=2, the user interface is refreshed to reflect theevents indicated by the outstanding indications. Also when the refreshtimer fires, the length of the delay period is multiplied by apredetermined factor, in this example 2, thus setting the delay periodto D=2.

Now suppose yet another event indication arrives at time t=2 (but not intime to be included in the refresh scheduled for t=2). This is withinthe new delay period D=2 of the last refresh, and therefore the userinterface is not refreshed straightaway, and a refresh timer isscheduled for the new delay time D=2 plus the time of last refresh t=2,i.e. scheduled for t=4. In the meantime, a further event indication mayarrive at time t=3 but this will also be ignored until the timer firesat time t=4. When the refresh timer then does fire at time t=4, the userinterface is refreshed to reflect the events indicated by bothoutstanding indications, preferably as part of the same refreshoperation and thus saving processor cycles since two separate refreshoperations are not required at separate times to reflect eachindividually. Also when the refresh timer fires, the length of the delayperiod is multiplied again by the predetermined factor 2, thus settingthe delay period to D=4.

Now suppose a yet further event indication arrives at time t=4 (but notin time to be included in the refresh scheduled for t=4). This is withinthe new delay period D=4 of the last refresh, and therefore the userinterface is not refreshed straightaway, and a refresh timer isscheduled for new delay time D=4 plus the time of last refresh t=4, i.e.scheduled for t=8. In the meantime, yet more event indications mayarrive for example at times t=5 and t=7 but these will also be ignoreduntil the timer fires at time t=8. When the refresh timer then does fireat time t=8, the user interface is refreshed to reflect the eventsindicated by all three outstanding indications, preferably as part ofthe same refresh operation and thus saving processor cycles since threeseparate refresh operations are not required at separate times toreflect each individually. Also when the refresh timer fires, the lengthof the delay period is multiplied again by the predetermined factor 2,thus setting the delay period to D=8.

Now suppose a yet further event indication arrives at time t=9, afterthe refresh performed at t=8. This is within the new delay period D=8 ofthe last refresh, and therefore the user interface is not refreshedstraightaway, and a refresh timer is scheduled for new delay time D=8plus the time of last refresh t=8, i.e. scheduled for t=16. In themeantime, yet more event indications may arrive for example at timest=11, t=14 and t=15 but these will also be ignored until the timer firesat time t=16. When the refresh timer then does fire at time t=16, theuser interface is refreshed to reflect the events indicated by all theoutstanding indications. The length of the delay period would also bemultiplied by 2 again, except in this example the length is capped at amaximum of 8.

Then say for example that no more event indications arrive until a latertime t=25. The delay period expired at t=24 (the time of last refresht=16 plus the delay D=8). Therefore according to the algorithm, the userinterface is refreshed straightaway upon receiving the indication att=25, and the delay period is reset to its lowest value of D=1.

The present invention has a particularly advantageous application to aninternet-enabled mobile phone. In that case the modem 202 is a wirelesscellular modem for connecting to the internet via a mobile cellularnetwork. In preferred embodiments, this is distinct from the situationdescribed earlier in relation to FIG. 2 whereby a mobile phone notinstalled with a VoIP or P2P client is able to still access the VoIP orP2P system via a client application running on the gateway 106. Rather,a client application is installed and run directly on the mobile phoneitself. In that case the mobile terminal can be considered one of theuser terminals 102 shown schematically in FIG. 2, although some kind ofgateway to the internet 108 will typically still be involved as part ofthe mobile network operators' infrastructure.

As mentioned, this is a particularly advantageous application of theinvention since the processing cost of a refresh operation may start tobecome a particular problem with the rise of VoIP communicationsimplemented on internet-enabled mobile phones, where processingresources are more limited than in more conventional PC basedapplications (although the present invention can still have a benefitfor PCs or other types of terminal as well).

It will be appreciated that the above embodiments are described only byway of example.

For instance, the above is only an example of a back-off algorithm. Itwill be appreciated given the disclosure herein that any back-offalgorithm could be used whereby the length of time period for which therefresh is postponed increases with some measure of the number, rate ortiming of incoming event indications. For example, instead of measuringthe time between arrival of an event indication and the time of lastrefresh, e.g. as in step (a) above, the algorithm could alternatively oradditionally measure the time interval between the arrival of two ormore event indications and set the delay period in dependence on thatinterval. Or the algorithm could operate by measuring an averageincoming rate R_(av) of event indications and calculating the length ofthe delay period D by a function D=f (R_(av)), where the preferred formoff may be determined by simulation or empirical testing of differenttrial functions.

Also note that “rate” does not necessarily mean a regular rate, but moregenerally can refer to any measure of a number of event indicationsreceived per unit time, during any window of time, whether regular ornot.

During the delay period, it is not necessarily the case that allincoming event indications of all kinds are ignored. Where it isreferred to receiving a plurality of event indications or similar, thiscould refer only to a certain set or type of event indications, andwhere it is referred to postponing the refresh to reflect anyindications this could only mean any indications of that type or set.

Where it is said that an event indication arrives or is received from anexternal source, the receipt or arrival need not necessarily refer tothe immediate capture from the external medium into the terminal.Instead, it may also involve some amount of buffering and/or dataprocessing. That is, the “receipt” or “arrival” of the indication mayactually refer to the meaningful recognition of the indication by thealgorithm in question rather than the physical receipt or arrival. Insome cases for example, when the client is launched after a certaintime, it may receive a plurality of event indications that have beenstored or cached during that time either locally or at a remote terminalsuch as a server. Either way, the indications may still indicateexternal events even though they have been stored for a time beforebeing received by the client's refresh algorithm.

In addition to external events occurring over the network, the algorithmcould also take into account local events such as from those originatingfrom peripherals, e.g. like mouse clicks or keyboard events. These couldoccur for example when the local user changes his or her own presence orprofile information or types a chat message, etc. Though preferably thealgorithm would at least take into account external events occurringover the network.

Although the above has been described mainly in terms of a peer-to-peer(P2P) system, the present invention is not specific to P2P and may beapplied to any kind of packet-based communications system, such as morethe centralised VoIP systems mentioned previously. Further, the presentinvention is not limited to use over the Internet, but could beimplemented over any packet-based network.

Further, the present invention is not limited only to refreshing a userinterface to reflect events signalled over a network or as part of acommunication system. More generally, the present invention can beapplied to optimize the refreshing of a user interface to reflect anyexternal event occurring externally to the receiving terminal, or eveninternally.

In preferred embodiments, the refresh back-off algorithm is implementedby software stored on a general purpose memory such as flash memory orhard drive an executed on a general purpose processor, the softwarepreferably but not necessarily being integrated as part of the clientapplication. However, alternatively the algorithm could be implementedin firmware or even in dedicated hardware. The algorithm could be anytype of process, e.g. it could comprise a series of conditional stepssuch as those described above, and/or an equation like D=f (R_(av)),and/or it could comprise referring to a look-up table.

Other configurations and applications of the present invention may beapparent to the person skilled in the art given the disclosure herein.The scope of the invention is not limited by the described embodiments,but only by the appended claims.

1. A method for limiting processing resources incurred due to refreshinga user interface of a first terminal, the method comprising: at a firstterminal, receiving a plurality of event indications which indicaterespective events, each of the event indications being received at adifferent time; and based on the event indications, refreshing the userinterface of the first terminal to reflect each of the respectiveevents; wherein said refreshing comprises determining a plurality oftime periods, and during each of said time periods postponing the userinterface from being refreshed to reflect any outstanding ones of saidevent indications until that time period has elapsed; and wherein saidtime periods are each determined having a length set in dependence on atiming of the receipt of one or more of said event indications, thelength of a later of said time periods being set to an increased valuerelative to an earlier of said time periods in response to the receiptof one or more of said event indications within a time limit.
 2. Themethod of claim 1, wherein said event indications indicate respectiveevents occurring externally to the first terminal.
 3. The method ofclaim 2, wherein: the method is a method of limiting processingresources incurred due to refreshing a user interface of a firstterminal in a communication system for communicating between the firstand other terminals via a packet-based network; and the receipt of saidevent indications comprises: at the first terminal of the communicationsystem, receiving a plurality of event indications signalled over thepacket-based network to indicate respective events occurring in relationto one or more of the other terminals of the communication system. 4.The method of claim 2, comprising receiving further event indicationsindicative of events occurring locally at the first terminal, said timeperiods being determined in dependence on the timing of receipt of oneor more event indications indicating either one of an external and alocal event.
 5. The method of claim 1, wherein the time limit is theexpiry of earlier time period running since last refresh of the userinterface.
 6. The method of claim 1, wherein the time limit is based ona time interval between the receipt of two event indications.
 7. Themethod of claim 1, wherein the event indications are receivedasynchronously with respect to the first terminal.
 8. The method ofclaim 1, wherein said refreshing comprises, during at least one of saidtime periods, postponing the user interface from being refreshed toreflect an outstanding plurality of said event indications until thattime period has elapsed, such that following said time period the userinterface is refreshed to reflect the plurality of outstanding eventindications in the same refresh operation.
 9. The method of claim 1,wherein said time periods are each determined having a length setaccording to a substantially exponential back-off process, whereby thelength of the later time period is multiplied by a predetermined factorrelative to the earlier time period in response to receipt of one ormore of said event indications within said time limit.
 10. The method ofclaim 1, comprising constraining the length to being set within amaximum cap value.
 11. The method of claim 5, wherein the length of thelater time period is increased unless fewer than a predetermined numberof said event indications are received during the earlier time period.12. The method of claim 11, wherein the length of the later time periodis increased unless none of said event indications are received duringthe earlier time period.
 13. The method of claim 12, wherein the lengthof the later timer period is reset to a lower value if fewer than apredetermined number of event indications are received during theearlier time periods.
 14. The method of claim 13, wherein the length ofthe later time period is reset if none of said event indications arereceived during the earlier time period.
 15. The method of claim 5,wherein, if at least a predetermined number of said event indicationsare received within the earlier time period running since the lastrefresh, then next refresh of the user interface is postponed until theearlier time period has elapsed and the length of the later time periodis increased, the later time period running from the next refresh. 16.The method of claim 15 wherein, if fewer then a predetermined number ofsaid event indications are received within the earlier time periodrunning since the last refresh, then the next refresh of the userinterface is not postponed and the length of the later time periodrunning from that next refresh is reset to a lower value.
 17. The methodof claim 16 wherein, if any of said event indications arrives within theearlier time period running since the last refresh, then the nextrefresh of the user interface is postponed until the earlier time periodhas elapsed and the length of the later period running from that nextrefresh is increased.
 18. The method of claim 17 wherein, if none saidevent indications arrives within the earlier time period running sincethe last refresh, then the next refresh of the user interface is notpostponed and the length of the later time period running from that nextrefresh is reset to a lower value.
 19. The method of claim 1, whereinsaid time periods are determined according to the following process: atprogram initialisation, set a delay to an initial value, the delay beinga variable setting the lengths of said time periods; upon receiving oneof said event indications: (a) calculate a time difference between acurrent clock time and a time of last refresh; (b) if the timedifference is greater than the delay: (i) perform the user interfacerefresh and save the current clock time as the time of last refresh,(ii) reset the delay to the initial value; (c) if the time difference isless than the delay: (i) if there is no current refresh timer thenschedule a refresh timer to fire at the last refresh time plus thedelay, (ii) if there is already a current refresh timer then do notschedule another refresh timer; when the refresh timer fires: (d)perform the user interface refresh and save the current clock time asthe time of last refresh; (e) multiply the delay by a predeterminedfactor.
 20. The method of claim 3, wherein: the first terminal is amobile terminal, and said communication system is a VoIP system, themobile terminal being installed with a VoIP client for communicatingwith the other terminals via a mobile cellular network and the internet;the receipt of the event indications comprises receiving the eventindications via the internet and mobile cellular network; and therefreshing comprises refreshing a user interface of the VoIP client. 21.A program product for limiting processing resources incurred due torefreshing a user interface of a first terminal, the program productcomprising code embodied on a computer-readable medium and beingconfigured so as when executed on the first terminal to: receive aplurality of event indications which indicate respective events, each ofthe event indications being received at a different time; and based onthe event indications, refresh the user interface of the first terminalto reflect each of the respective events; wherein said refreshingcomprises determining a plurality of time periods, and during each ofsaid time periods postponing the user interface from being refreshed toreflect any outstanding ones of said event indications until that timeperiod has elapsed; and wherein said time periods are each determinedhaving a length set in dependence on a timing of the receipt of one ormore of said event indications, the length of a later of said timeperiods being set to an increased value relative to an earlier of saidtime periods in response to receipt of one or more of said eventindications within a time limit.
 22. The program product of claim 21,the program product being a communication client application forcommunicating between the first and other terminals via a packet-basednetwork, the communication client comprising code configured so as whenexecuted on the first terminal: the receipt of said event indicationscomprises: at the first terminal of the communication system, receivinga plurality of event indications signalled over the packet-based networkto indicate respective events occurring in relation to one or more ofthe other terminals of the communication system.
 23. The program productof claim 22, wherein the first terminal is a mobile terminal, thecommunication client being a VoIP client for communicating between themobile terminal and the other terminals via a mobile cellular networkand the internet, the VoIP client comprising code configured so as whenexecuted on the mobile terminal: the receipt of the event indicationscomprises receiving the event indications via the internet and mobilecellular network; and the refreshing comprises refreshing a userinterface of the VoIP client.
 24. A first terminal comprising: areceiver configured to receive a plurality of event indications whichindicate respective events, each of the event indications being receivedat a different time; a screen for displaying a user interface; andprocessing circuitry, coupled to the receiver and screen, configured torefresh the user interface based on the event indications to reflecteach of the respective events; wherein the processing circuitry isconfigured to generate a plurality of time periods, and during each ofsaid time periods to postpone the user interface from being refreshed toreflect any outstanding ones of said event indications until that timeperiod has elapsed; and the processing circuitry is configured togenerate each of said time periods having a length set in dependence ona timing of the receipt of one or more of said event indications, thelength of a later of said time periods being set to an increased valuerelative to an earlier of said time periods in response to receipt ofone or more of said event indications within a time limit.
 25. The firstterminal of claim 24, wherein: the first terminal comprises atransceiver for communicating with other terminals via packet-basednetwork, the transceiver including said receiver and the receiver beingconfigured to receive a plurality of event indications signalled overthe packet-based network to indicate respective events occurring inrelation to one or more of the other terminals; and the processingcircuitry comprises a memory and processor coupled to the transceiver,screen and memory, the memory storing a communication client applicationcomprising code configured so as when executed on the processor toenable communication between the first and other terminals via thetransceiver and packet-based network, and to perform said refreshing ofthe user interface.
 26. The first terminal of claim 25, wherein: thefirst terminal is a mobile terminal; the transceiver is configured tocommunicate via a mobile cellular network and the internet, the receiverbeing configured to receive the event indications via the internet andmobile cellular network; the communication client is a VoIP clientconfigured so as when executed on the processor to enable communicationbetween the first and the other terminals via the transceiver, mobilecellular network and internet.